package com.song.tools.songtest.convertor;

import com.song.tools.mvc.convertor.AggregationConvertor;
import com.song.tools.songtest.beans.bo.SysRoleBo;
import com.song.tools.songtest.beans.poi.SysRoleExportDto;
import com.song.tools.songtest.beans.poi.SysRoleImportDto;
import com.song.tools.songtest.beans.query.SysRoleQuery;
import com.song.tools.songtest.beans.request.SysRoleQueryRequest;
import com.song.tools.songtest.beans.request.SysRoleSaveRequest;
import com.song.tools.songtest.beans.request.SysRoleUpdateRequest;
import com.song.tools.songtest.beans.response.SysRoleQueryResponse;
import com.song.tools.songtest.beans.response.SysRoleSaveResponse;
import com.song.tools.songtest.beans.response.SysRoleUpdateResponse;
import com.song.tools.songtest.dao.entity.SysRole;
import org.mapstruct.AfterMapping;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.ReportingPolicy;

import java.util.List;

/**
 * <p>
 * 角色表 转换器
 * </p>
 *
 * @author song tools
 * @since 2024-07-12
 */
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public abstract class SysRoleConvertor implements AggregationConvertor<SysRole, SysRoleBo, SysRoleQuery, SysRoleQueryRequest, SysRoleQueryResponse,
        SysRoleSaveRequest, SysRoleSaveResponse, SysRoleUpdateRequest, SysRoleUpdateResponse, SysRoleImportDto, SysRoleExportDto> {

    @Override
    public abstract SysRole entityBoToEntity(SysRoleBo sysRoleBo);

    @Override
    public abstract SysRoleBo entityToEntityBo(SysRole sysRole);

    @Override
    public abstract SysRoleQueryResponse entityBoToQueryResponse(SysRoleBo sysRoleBo);

    @Override
    public abstract SysRoleQuery queryRequestToQuery(SysRoleQueryRequest queryRequest);

    @Override
    public abstract SysRoleBo saveRequestToEntityBo(SysRoleSaveRequest request);

    @Override
    public abstract SysRoleSaveResponse entityBoToSaveResponse(SysRoleBo sysRoleBo);

    @Override
    public abstract SysRoleBo updateRequestToEntityBo(SysRoleUpdateRequest request);

    @Override
    public abstract SysRoleUpdateResponse entityBoToUpdateResponse(SysRoleBo sysRoleBo);

    @Override
    public abstract List<SysRole> entityBoToEntity(List<SysRoleBo> entityBo);

    @Override
    public abstract List<SysRoleBo> entityToEntityBo(List<SysRole> entity);

    @Override
    public abstract SysRoleExportDto entityBoToExportDto(SysRoleBo entityBo);

    @Override
    public abstract SysRoleBo importDtoToEntityBo(SysRoleImportDto importDto);

    @Override
    public abstract List<SysRoleBo> importDtoToEntityBo(List<SysRoleImportDto> importDto);


    @AfterMapping
    public void afterMappingEntityBoToEntity(@MappingTarget SysRole sysRole, SysRoleBo sysRoleBo) {
        // entityBoToEntity() 内部其它代码执行完之后，最后会自动执行 afterMappingEntityBoToEntity()
    }

    @AfterMapping
    public void afterMappingEntityToEntityBo(@MappingTarget SysRoleBo sysRoleBo, SysRole sysRole) {
        // entityToEntityBo() 内部其它代码执行完之后，最后会自动执行 afterMappingEntityToEntityBo()
    }

    @AfterMapping
    public void afterMappingQueryRequestToQuery(@MappingTarget SysRoleQuery sysRoleQuery, SysRoleQueryRequest sysRoleQueryRequest) {
        // queryRequestToQuery() 内部其它代码执行完之后，最后会自动执行 afterMappingQueryRequestToQuery()
    }

    @AfterMapping
    public void afterMappingEntityBoToQueryResponse(@MappingTarget SysRoleQueryResponse sysRoleQueryResponse, SysRoleBo sysRoleBo) {
        // entityBoToQueryResponse() 内部其它代码执行完之后，最后会自动执行 afterMappingEntityBoToQueryResponse()
    }

    @AfterMapping
    public void afterMappingEntityBoToSaveResponse(@MappingTarget SysRoleSaveResponse sysRoleSaveResponse, SysRoleBo sysRoleBo) {
        // entityBoToSaveResponse() 内部其它代码执行完之后，最后会自动执行 afterMappingEntityBoToSaveResponse()
    }

    @AfterMapping
    public void afterMappingSaveRequestToEntityBo(@MappingTarget SysRoleBo sysRoleBo, SysRoleSaveRequest sysRoleSaveRequest) {
        // saveRequestToEntityBo() 内部其它代码执行完之后，最后会自动执行 afterMappingSaveRequestToEntityBo()
    }

    @AfterMapping
    public void afterMappingEntityBoToUpdateResponse(@MappingTarget SysRoleUpdateResponse sysRoleUpdateResponse, SysRoleBo sysRoleBo) {
        // entityBoToUpdateResponse() 内部其它代码执行完之后，最后会自动执行 afterMappingEntityBoToUpdateResponse()
    }

    @AfterMapping
    public void afterMappingUpdateRequestToEntityBo(@MappingTarget SysRoleBo sysRoleBo, SysRoleUpdateRequest sysRoleUpdateRequest) {
        // updateRequestToEntityBo() 内部其它代码执行完之后，最后会自动执行 afterMappingUpdateRequestToEntityBo()
    }

    @AfterMapping
    public void afterMappingImportDtoToEntityBo(@MappingTarget SysRoleBo sysRoleBo, SysRoleImportDto sysRoleImportDto) {
        // importDtoToEntityBo() 内部其它代码执行完之后，最后会自动执行 afterMappingImportDtoToEntityBo()
    }

    @AfterMapping
    public void afterMappingEntityBoToExportDto(@MappingTarget SysRoleExportDto sysRoleExportDto, SysRoleBo sysRoleBo) {
        // entityBoToExportDto() 内部其它代码执行完之后，最后会自动执行 afterMappingEntityBoToExportDto()
    }
}
